<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <style>
    .box {
      width: 500px;
      height: 500px;
      border: 1px solid;
      position: relative;
    }
  
    .item {
      width: 200px;
      height: 200px;
      position: absolute;
      top: 10px;
      left: 10px;
      /* margin-top: 10px; */
      border: 1px solid;
    }
  </style>
</head>
<body>
  <div class="box">
    <div class="item"></div>
  </div>

  <script src="../libs/jquery-1.12.4.js"></script>
  <script>
    /* 
      postion返回的是一个对象，对象中包含了left和top的值

      该元素距离其offsetParent的偏移量
    
    */
    $(function () {
      
      console.log($('.item').position())
    })
    
  </script>
</body>
</html>